package com.springcloud.travel.aviation.controller;

import com.springcloud.travel.aviation.service.AviationService;
import com.springcloud.travel.entity.Aviation;
import com.springcloud.travel.entity.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/aviation")
public class AviationController {

    @Autowired
    private AviationService aviationService;

    /**
     * 获取省市区
     * @param pid
     * @return
     */
    @RequestMapping("/getCity")
    public List<City> getByCityPid(Integer pid){

        if (pid!=null){
            return aviationService.selectByPid(pid);
        }
        return null;
    }

    /**
     * 获取航空仓位
     * @param pid
     * @return
     */
    @RequestMapping("/getAviation")
    public List<Aviation> getByAviationPid(Integer pid){

        if (pid!=null){
            return aviationService.selectByAviationPid(pid);
        }
        return null;
    }
    @RequestMapping("/show")
    List<Aviation> show(@RequestParam Map<String, Object> map){

        return null;


    }



}
